// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	1/4/2014 8:54:58 PM				
// -----------------------------

#ifndef _Quaternion_h
#define _Quaternion_h

#include "Defines.h"

struct Vector3;
struct Vector4;
struct Matrix;

struct Quaternion
{

	/* Datamembers */
	Float	x;
	Float	y;
	Float	z;
	Float	w;

	/* Constructors */
	Quaternion();
	Quaternion(Float X, Float Y, Float Z, Float W);
	Quaternion(const Quaternion& refQuaternion);
	Quaternion& operator=(const Quaternion& refQuaternion);

	/* Equality Operators */
	Bool operator==(const Quaternion& refQuaternion) const;
	Bool operator!=(const Quaternion& refQuaternion) const;
	Bool operator<(const Quaternion& refQuaternion) const;
	Bool operator>(const Quaternion& refQuaternion) const;
	Bool operator<=(const Quaternion& refQuaternion) const;
	Bool operator>=(const Quaternion& refQuaternion) const;

	/* Mathematical Out-Of-Place Operators */
	Quaternion	operator*(const Quaternion& refQuaternion) const;
	Vector3		operator*(const Vector3& refVector) const;
	Vector4		operator*(const Vector4& refVector) const;

	/* Methods */
	Quaternion	Normalized() const;
	Quaternion	Conjugate() const;
	Matrix		ToMatrix() const;
	void			AsArray(Float arrFloat[4]) const;

	/* Static Methods */
	static Quaternion	FromEulerAngles(const Vector3& vAxis, Float fAngle);
	static Quaternion	FromEulerAngles(const Vector4& vAxis, Float fAngle);

};

#endif